package tw.asap.plus.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
import tw.asap.plus.R;
import tw.asap.plus.entity.User;
import tw.asap.plus.ui.AsapBaseActivity;
import tw.asap.plus.ui.custom.AppBar;
import tw.asap.plus.utils.Utils;

/**
 * Created by Yax.
 * Date: 15/11/16
 * Time: 下午10:25
 * Description:
 */
public class AboutActivity extends AsapBaseActivity implements View.OnClickListener {


    @InjectView(R.id.appbar)
    AppBar appbar;
    @InjectView(R.id.icon)
    ImageView icon;
    @InjectView(R.id.tv_version_code)
    TextView tvVersionCode;
    @InjectView(R.id.button)
    TextView button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        ButterKnife.inject(this);
        initView();
    }

    private void initView() {
        appbar.setLeftClickEvent(this);
        tvVersionCode.setText("v" + Utils.getAppVersion(this));
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_navigation_header_left:
                finish();
                break;
        }
    }

    @OnClick(R.id.button)
    protected void exit(){
        User.logOut();
        MainActivity.REFRESH_ALL_FRAGMENT = 1;
        finish();
    }
}
